<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
    <title>我的</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" href="../../css/set.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.min.css"/>
    <style type="text/css">
        .aui-bar {
            margin-top: 0.75rem;
        }

        #demo .aui-bar-btn-item.aui-active {
            background-color: transparent;
            color: #212121;
        }

        /*列表logo*/

        .up_down {
            background-image: url(../../image/btn/setting_hzld@2x.png);
        }

        .add_wechat {
            background-image: url(../../image/btn/setting_jrwxq@2x.png);
        }

        .exch_look {
            background-image: url(../../image/btn/setting_hlgl@2x.png);
        }

        .idea_return {
            background-image: url(../../image/btn/setting_yjfk@2x.png);
        }

        .for_us {
            background-image: url(../../image/btn/setting_gywm@2x.png);
        }

        .up_down,
        .add_wechat,
        .exch_look,
        .idea_return,
        .for_us {
            margin-right: 0.25rem;
            background-size: 1rem 1rem;
            background-repeat: no-repeat;
            background-position: center left;
            min-width: 2rem;
        }

        .my_logo {
            background-image: url(../../image/setting-bg2.png);
            background-repeat: no-repeat;
            background-size: 100%;
            background-position: center;
        }

        img.aui-img-round {
            border-radius: 50%;
        }

        img {
            border: 3px solid #2F85E6;
        }

        /*footer样式*/

        span.active-icon-hq,
        span.icon-hq,
        span.active-icon-sz,
        span.icon-sz {
            position: relative;
            margin-top: 0;
            padding: 0;
            width: 1rem;
            height: 1rem;
            display: inline-block;
            background-size: 1rem;
            background-repeat: no-repeat;
            background-position: center;
        }

        span.active-icon-hq {
            background-image: url(../../image/btn/tab_hq_1@2x.png);
        }

        span.icon-hq {
            background-image: url(../../image/btn/tab_hq_0@2x.png);
        }

        span.active-icon-sz {
            background-image: url(../../image/tab_wode_1@2x.png);
        }

        span.icon-sz {
            background-image: url(../../image/tab_wode_0@2x.png);
        }

        .aui-bar-tab .aui-bar-tab-label {
            display: block;
            font-size: 0.6rem;
            margin-top: -0.25rem;
            position: relative;
        }

        .active-font {
            color: #1569C8;
        }

        .top {
            margin-bottom: 1.1rem !important;
            padding: 0.75rem;
            padding-top: 1.75rem;
            position: relative;
            width: 100%;
            height: 12.5rem;
            font-size: 0.6rem;
        }

        .top-on {
            background: url("../../image/wode_top_bg2@2x.png") no-repeat;
            background-size: 100%;
        }

        .top-off {
            background: url("../../image/wode_top_bg1@2x.png") no-repeat;
            background-size: 100%;
        }

        .top-item {
            display: block;
        }

        .top-item1 {
            display: inline-block;
        }

        .top-text-id {
            color: #92c6fd;
            font-size: 0.6rem;
            line-height: 0.6rem;
        }

        .top-text-assets {
            font-size: 0.7rem;
            line-height: 0.7rem;
            color: #ffffff;
        }

        .top-text-assets-nbr {
            font-size: 1.5rem;
            line-height: 1.5rem;
            color: #ffffff;
            font-weight: 500;
            margin-top: 0.5rem;
        }

        .top-text-profit {
            font-size: 0.7rem;
            line-height: 0.7rem;
            color: #ffffff;
            margin-top: 1rem;
        }

        .profit {
            color: #09d034;
            font-size: 1.05rem;
            line-height: 1.05rem;
            font-weight: 500;
            margin-top: 0.45rem;
        }

        .loss {
            color: #fb7171;
            font-size: 1.05rem;
            line-height: 1.05rem;
            font-weight: 500;
            margin-top: 0.45rem;
        }

        .profit-off {
            color: #92c6fd;
            font-size: 1.2rem;
            line-height: 1.2rem;
            font-weight: 500;
            margin-top: 0.45rem;
        }

        .top-text-assets-nbr-off {
            font-size: 1.5rem;
            line-height: 1.5rem;
            color: #92c6fd;
            font-weight: 500;
            margin-top: 0.5rem;
        }

        .personal-data {
            position: absolute;
            left: 0.75rem;
            top: 4.25rem;
        }

        .top-btn {
            position: absolute;
            right: 0.75rem;
            top: 1.75rem;
            border: 1px solid #92c6fd;
            border-radius: 0.1rem;
            padding: 0.1rem 0.6rem;
            color: #92c6fd;
            font-size: 0.6rem;
            background-color: transparent;
        }

        .top-look {
            position: absolute;
            right: 0.75rem;
            top: 6.5rem;
            color: #92c6fd;
            font-size: 0.6rem;
            height: 0.9rem;
            line-height: 0.9rem;
        }

        .top-look-off {
            color: #fff;
            font-size: 0.6rem;
            height: 0.9rem;
            line-height: 0.9rem;
            box-sizing: border-box;
        }

        .top-look-img {
            float: right;
            transform: rotate(-90deg);
            height: 100%;
            border: none;
        }

        .top-login-btn-img {
            float: right;
            height: 100%;
            border: none;
        }

        .top-login-btn {
            position: absolute;
            right: 0.75rem;
            top: 6.5rem;
            padding: 0.25rem 0.4rem 0.25rem 0.7rem;
            border: 1px solid #fff;
            border-radius: 0.9rem;
        }

        .top-text {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 1.4rem;
            line-height: 1.4rem;
            color: #f4e75a;
            text-align: center;
            background-color: rgba(145, 192, 253, 0.3);
        }
    </style>
</head>

<body>

<!--登入后的样式-->
<div id="top">
    <section class="top top-off">
        <!--<div class="personal-data">-->
        <!--<span class="top-item top-text-assets">总资产</span>-->
        <!--<span class="top-item top-text-assets-nbr-off">- - - -</span>-->
        <!--<span class="top-item top-text-profit">当日盈亏</span>-->
        <!--<span class="top-item profit-off">- - -</span>-->
        <!--</div>-->
        <!--<div class="top-login-btn">-->
        <!--<div class="top-look-off" onclick="gologin()">-->
        <!--手机登录-->
        <!--<img src="../../image/setting_add_more@2x.png" alt="" class="top-login-btn-img">-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="top-text">-->
        <!--直接手机登录查看个人币资产-->
        <!--</div>-->
    </section>
</div>
<!--<section class="top top-on" onclick="todetail()">-->
<!--<span class="top-item1 top-text-id">ID:18700000000</span>-->
<!--<div class="personal-data">-->
<!--<span class="top-item top-text-assets">总资产</span>-->
<!--<span class="top-item top-text-assets-nbr">31,900.00</span>-->
<!--<span class="top-item top-text-profit">当日盈亏</span>-->
<!--<span class="top-item profit">-0.32%</span>-->
<!--</div>-->
<!--<div class="top-btn" href="login.html">退出</div>-->
<!--<div class="top-look">-->
<!--查看信息-->
<!--<img src="../../image/nav_btn_zk@2x.png" alt="" class="top-look-img">-->
<!--</div>-->
<!--</section>-->
<!--登入前的样式-->

<section class="aui-content">
    <ul class="aui-list aui-list-in aui-margin-b-15">
        <li class="aui-list-item">
            <div class="aui-list-item-label-icon up_down">

            </div>
            <div class="aui-list-item-inner">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-title">红涨绿跌</div>
                    <div class="aui-list-item-right">
                        <input type="checkbox" class="aui-switch" checked>
                    </div>
                </div>
            </div>
        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-label-icon add_wechat"></div>
            <a href="add_wechat.html" class="aui-list-item-inner aui-list-item-arrow">
                <div class="aui-list-item-title">加入微信群
                    <div class="aui-badge" style="position:relative;top:0; left:0">欢迎加入</div>
                </div>
            </a>
        </li>
    </ul>
    <ul class="aui-list aui-list-in second_list">

        <li class="aui-list-item">
            <div class="aui-list-item-label-icon exch_look">

            </div>
            <a href="exch_look.html" class="aui-list-item-inner aui-list-item-arrow">
                <div class="aui-list-item-title">汇率概览</div>

            </a>

        </li>

        <li class="aui-list-item">
            <div class="aui-list-item-label-icon idea_return">

            </div>
            <a href="idea_return.html" class="aui-list-item-inner aui-list-item-arrow">
                <div class="aui-list-item-title">意见反馈</div>
            </a>

        </li>
        <li class="aui-list-item">
            <div class="aui-list-item-label-icon for_us">

            </div>
            <!--<a href="for_us.html">-->
            <a href="for_us.html" class="aui-list-item-inner aui-list-item-arrow">
                <div class="aui-list-item-title">关于我们</div>

            </a>
            <!--</a>-->
        </li>
    </ul>
    <div class="aui-card-list-footer aui-text-center aui-border-t">
        <div class="aui-text-info">kktoken 版本V 0.1</div>
    </div>
</section>
<!-- //底部固定菜单栏 -->
<footer class="aui-nav" id="aui-footer">

    <ul class="aui-bar aui-bar-tab" id="footer">
        <li id="hangqing" class="aui-bar-tab-item actve-font" tapmode>
            <a href="../../index.html" class="aui-bar-tab-item" tapmode>
                <span class="icon-hq"></span>
                <div class="aui-bar-tab-label">行情</div>
            </a>
        </li>

        <li id="shezhi" class="aui-bar-tab-item" tapmode>
            <a href="set.html">
                <span class="active-icon-sz"></span>
                <div class="aui-bar-tab-label active-font">我的</div>
            </a>
        </li>
    </ul>

</footer>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script src="../../script/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../../script/set.js"></script>
<script src="../../script/tool.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../../jquery-2.1.3.min.js"></script>
<script type="text/javascript">

  var appVersion
  var os
  var osVersion
  var bizhichanList = JSON.parse(localStorage.getItem('bizhichanList')) || [];
  var ZC = 0
  var zhongZC = 0
  var dangrYK = 0

  apiready = function () {
    appVersion = "1.0.0"
    os = api.systemType
    osVersion = api.systemVersion


  }

  ajax_fordata()

  function ajax_fordata() {
    var dataArr = [];

    for (let i of bizhichanList) {
      dataArr.push({
        name: i.tokenName,
        symbol: i.AbbreviationName
      })
    }


    if (localStorage.isLogin == 1) {
      var si = setInterval(function () {
        if (window.parent.headers != {}) {
          clearInterval(si)
          $.ajax({
            url: orginlink + '/allcoin/getCoinInfo',
            data: {
              coinArray: JSON.stringify(dataArr)
            },
            type: 'GET',
            headers: {
              appVersion: appVersion,
              os: os,
              osVersion: osVersion
            },
            contentType: "application/json",
            dataType: 'json',
            success: function (result) {


              if (result.code == 0) {
                for (let i of bizhichanList) {
                  for (let x of result.result) {
                    zhongZC += x.priceCNY * i.number;
                    dangrYK += parseInt(x.changemoney);
                  }
                  if (i.moneyType == 1) {
                    ZC += i.money * i.number
                  } else {
                    ZC += i.money
                  }
                }
              }


              $("#top").html(`<section class="top top-on">
    <span class="top-item1 top-text-id">ID:${localStorage.phone}</span>
    <div  onclick="todetail()">

    <div class="personal-data">
        <span class="top-item top-text-assets">总资产</span>
        <span class="top-item top-text-assets-nbr" style="color: ${zhongZC == 0 ? '#92c6fd' : '#fff'}">${zhongZC ? zhongZC : '- - - -'}</span>
        <span class="top-item top-text-profit">当日盈亏</span>
        <span id="zf" class="top-item profit" style="color: ${((dangrYK / zhongZC * 100) ? (dangrYK / zhongZC * 100) > 0 ? getRiseColor() : (dangrYK / zhongZC * 100) == 0 ? '#000' : getFallColor() : '#92c6fd')}">${(dangrYK / zhongZC * 100) ? (dangrYK / zhongZC * 100) + '%' : '- - -'}</span>
    </div>
    <div class="top-look">
        查看信息
        <img src="../../image/nav_btn_zk@2x.png" alt="" class="top-look-img">
    </div>
</div>
    <div class="top-btn" onclick="out()">退出</div>
</section>`)

            }
          });
        }
      }, 100)

    } else {
      out();
    }

  }

  if (localStorage.getItem("zhangColor") == 0 || !localStorage.getItem("zhangColor")) {
    $('input:checkbox').prop("checked", false);
  }


  $('input:checkbox').click(function () {
    localStorage.setItem("zhangColor", localStorage.getItem("zhangColor") == 0 ? 1 : 0);
    console.log(localStorage.getItem("zhangColor"))
    $("#zf").css("color", (dangrYK / zhongZC * 100) ? (dangrYK / zhongZC * 100) > 0 ? getRiseColor() : (dangrYK / zhongZC * 100) == 0 ? '#000' : getFallColor() : '#92c6fd');
  });

  var bar = document.querySelectorAll(".aui-bar-btn");
  if (bar) {
    for (var i = 0; i < bar.length; i++) {
      var d = bar[i];
      var tab = new auiTab({
        element: bar[i],
        repeatClick: true
      }, function (ret) {
        if (ret.dom.parentNode.getAttribute("type") && ret.dom.parentNode.getAttribute("type") == "count") {
          var count = parseInt(document.getElementById("count").value);
          if (ret.index == 2) return;
          if (ret.index == 1) {
            document.getElementById("count").value = count - 1;
          }
          if (ret.index == 3) {
            document.getElementById("count").value = count + 1;
          }
        }
      });

    }
  }

  function Transformation() {
    console.log("aaa")
  }

  function out() {
    console.log("ccc")
    localStorage.isLogin = 0;
    $("#top").html('<section class="top top-off">\n' +
      '    <div class="personal-data">\n' +
      '        <span class="top-item top-text-assets">总资产</span>\n' +
      '        <span class="top-item top-text-assets-nbr-off">- - - -</span>\n' +
      '        <span class="top-item top-text-profit">当日盈亏</span>\n' +
      '        <span class="top-item profit-off">- - -</span>\n' +
      '    </div>\n' +
      '    <div class="top-login-btn">\n' +
      '        <div class="top-look-off" onclick="gologin()">\n' +
      '            手机登录\n' +
      '            <img src="../../image/setting_add_more@2x.png" alt="" class="top-login-btn-img">\n' +
      '        </div>\n' +
      '    </div>\n' +
      '    <div class="top-text">\n' +
      '        直接手机登录查看个人币资产\n' +
      '    </div>\n' +
      '</section>')
  }

  function todetail() {

    window.location.href = "../detail/detail-bizichan.html";
  }

  function gologin() {
    console.log("bbbb")
    window.location.href = "login.html?appVersion=" + appVersion + "&os=" + os + "&osVersion=" + osVersion;
  }

  //点击跳转事件
  function quitlogin() {
  }
</script>
</html>
